#ifndef WEB_SERVER
#define WEB_SERVER

#include <Winsock2.h>
#include "v_socket.h"

#include <string>
#include <map>

typedef void (*CallBack)();
typedef std::map<std::string, CallBack> CommanMap; 

class WebServer {
private:
	short m_nPort;
	CommanMap m_commands; 
	void HandleRequest(VSocket& socket);
	void HandleContent(VSocket& socket);
public:
	WebServer(short port);
	void addCallBack(const char* path, CallBack command);
	void run();
};

#endif
